<?php
// 下架商品
// header("content-type:text/html;charset=utf-8");
include_once("conn.php");
//设置默认时区
date_default_timezone_set('PRC');
$now_date = date('Y-m-d H:i:s');

$gid = $_POST['gid'];

$sql = "UPDATE tb_goods_info SET g_is_sell = 0, g_outlinedate = '".$now_date."' WHERE g_id = '".$gid."'";
$result = mysqli_query($conn, $sql);
if($result){
    echo "<script>alert('下架成功！');window.location.href='../a_list_goods.php';</script>";
}else{
    echo "<script>alert('下架失败！请重试！');history.go(-1);</script>";
}